<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use App\Models\BillType;
use App\Models\User;

class Bill extends Model
{
    use HasFactory;

    public function user() {
        return $this->belongsTo(User::class);
    }

    public function billType()
    {
        return $this->belongsTo(BillType::class);
    }
    
    protected $fillable = [
        'bill_type_id', 
        'amount',
        'bill_time',
        'remark',
        'user_id' // 必须包含
    ];
}
